<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

//This controller is set o be the main-controller (default-controller in routes.php)

session_start();

class Welcome extends CI_Controller
{

    function __construct()
    {
        parent::__construct();
    }

	//If user is already logged in, redirect to that person homepage (/socialbuddy/index)
        //Else redirect to login-form (loginviews/login_form)
	public function index()
	{
            if ($this->session->userdata('is_logged_in'))
            {
                redirect('/socialbuddy/index','refresh');
	    }
            else
            {             
                $data['title'] = "Welcome to Fully Jacked";
                $data['main_content'] = 'loginviews/login_form';
                $this->load->vars($data);
                $this->load->view('includes/template');
	    }
        }

        //Load reset_passwordview
        function reset_password()
        {      
            $data['main_content'] = 'publicviews/reset_passwordview';
            $this->load->vars($data);
            $this->load->view('includes/template');
        }


}
